package com.daqian.chance.example.admin.modules.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqian.chance.example.admin.modules.system.mapper.SysUserRoleRelationMapper;
import com.daqian.chance.example.admin.modules.system.po.dto.SysUserRoleRelationDTO;
import com.daqian.chance.example.admin.modules.system.po.entity.SysUserRoleRelation;
import com.daqian.chance.example.admin.modules.system.service.ISysUserRoleRelationService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统-用户角色关系 服务实现类
 * </p>
 * @author daqian
 * @since 2019-08-08
 */
@Service
@Slf4j
public class SysUserRoleRelationServiceImpl extends ServiceImpl<SysUserRoleRelationMapper, SysUserRoleRelation> implements ISysUserRoleRelationService {
    @Override
    public PageInfo<SysUserRoleRelation> page(SysUserRoleRelationDTO sysUserRoleRelationDTO) {
        // 开启分页
        PageHelper.startPage(sysUserRoleRelationDTO.getPageNum(), sysUserRoleRelationDTO.getPageSize());
        List<SysUserRoleRelation> sysUserRoleRelationList = super.list(null);
        // 清除分页
        PageHelper.clearPage();
        return new PageInfo<>(sysUserRoleRelationList);
    }
}
